<template>
  <div :class="getAppLogoClass">
    <img v-show="false" src="@/assets/images/logo.png" alt="甬能云Logo">
    <div v-show="showTitle" class="ml-2 truncate md:opacity-100" :class="getTitleClass">{{title}}</div>
  </div>
</template>

<script lang="ts" setup>
import {useDesign} from '@/hooks/web/useDesign.ts'
import { useGlobSetting } from '@/hooks/setting'
import {computed} from "vue";

const props = defineProps({
  // 是否显示标题
  showTitle: { type: Boolean, default: true },
})
const { prefixCls } = useDesign('app-logo')
const getAppLogoClass = computed(() => [prefixCls])
const getTitleClass = computed(() => [
  `${prefixCls}__title`
])
const { title } = useGlobSetting()
</script>

<style lang="less" scoped>
@prefix-cls: ~'@{namespace}-app-logo';

.@{prefix-cls} {
  display: flex;
  align-items: center;
  padding-left: 7px;
  cursor: pointer;
  transition: all 0.2s ease;

  img {
    width: 50px;
  }
  &__title {
    color: @white;
    font-size: 16px;
    font-weight: 700;
    line-height: normal;
    transition: all 0.5s;
  }
}
</style>
